package com.ssy.lingxi.product.repository.warehouse;

import com.ssy.lingxi.product.api.model.response.warehouse.InvoicesTypeListResponse;
import com.ssy.lingxi.product.entity.warehouse.InvoicesType;
import com.ssy.lingxi.product.entity.warehouse.Warehouse;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface InvoicesTypeRepository extends JpaRepository<InvoicesType, Long>, JpaSpecificationExecutor<InvoicesType> {
    List<InvoicesType> findAllByStateEquals(Integer state);

    Page<InvoicesType> findByMemberIdAndMemberRoleIdAndNameContainingOrderByUpdateTimeDesc(Long memberId, Long memberRoleId, String name, Pageable page);

    Page<InvoicesType> findByMemberIdAndMemberRoleIdOrderByUpdateTimeDesc(Long memberId, Long memberRoleId, Pageable page);

    List<InvoicesType> findByMemberIdAndMemberRoleIdAndStateOrderByUpdateTimeDesc(Long memberId, Long memberRoleId, Integer state);
}
